<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>buyfunshop</title>
	<meta name="customer-service" />
	<meta name="promotion-tip" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<meta property="og:type" content="website" />
	<meta property="og:title"         content="【buyfunshop】" />
	<meta property="og:description"   content="ช้อปปิ้งง่ายมาก! แพลตฟอร์มช้อปปิ้งที่เน้นผู้บริโภคแฟชั่นสตรี สินค้ามีทั้งเสื้อผ้าสตรีแฟชั่น รองเท้าผู้หญิง กระเป๋าสตรี เครื่องประดับ ฯลฯ จัดส่งฟรีเกิน 899/ดำเนินการเองอย่างเป็นทางการ/เก็บเงินปลายทาง/ระยะเวลาชื่นชมเจ็ดวัน " />
	<meta property="og:image"
		content="//yinibuy2.oss-cn-hongkong.aliyuncs.com/729419af-b34f-4126-be31-e36aad7582dd.jpg" />
	<meta property="og:url" content="www.buyfunshop.com" />
	<link rel="stylesheet" href="../dists/mdui-0.4.3/css/mdui.css" />
	<link rel="stylesheet" href="../dists/swiper/css/swiper.css">
	<link rel="stylesheet" href="../resources/css/common.css" />
	<style>
		.mdui-nav-container{position:fixed;top:0;right:0;left:0;z-index:3;margin:0 auto;max-width:750px}
		.mdui-nav{position:relative;overflow:hidden;height:72px;background:#fff;box-shadow: 0 0px 4px 0px #bbb;padding: 0 10px;font-size: 0;}
		.mdui-nav .mdui-tab::-webkit-scrollbar {display: none;}
		.mdui-nav .mdui-tab a{padding: 0 8px;margin: 0 6px 0 0;height:40px!important;min-width:min-content;min-height:initial;text-transform:initial;opacity:1;cursor:pointer;position: relative; font-weight: 600; font-size: 15px;}
		.mdui-nav .mdui-tab a.mdui-tab-active{color: #ff4142;}
		.mdui-nav .logo{height:32px}
		.mdui-nav .logo_txt{color:#ff4142;font-size: 16px;letter-spacing: 2px;font-weight: bold;word-break: keep-all;height: 32px; line-height: 32px;display: block;}
		button.mdui-btn-icon{padding: 6px 0;}
		.mdui-tab-indicator{bottom:4px; height:4px;background:#ff4142;border-radius: 2px;opacity: 1;}
		.mdui-nav-select{position:absolute;top:0;right:0;left:0;display:none;box-sizing:border-box;width:100%;background:#fff}
		.mdui-nav-select>ul{display:flex;width:100%;flex-flow:row wrap;align-items:center; padding: 0 10px;box-sizing: border-box;}
		.mdui-nav-select .second_nav{padding: 0 10px 12px 10px;}
		.mdui-nav-select .second_nav li{padding: 8px 6px;line-height: 18px;box-sizing: border-box;width: 25%;}
		.mdui-nav-select>ul>li>span{color: #ff4142; font-weight: bold;}
		.mdui-nav-select>ul>li>a{display:inline-block;box-sizing:border-box;padding:8px;width:100%;border-radius:4px;background:#f1f1f1;vertical-align:middle;text-align:center;font-size:12px}
		.mdui-nav-select>ul>li>a.activeIndex{background:#fff;background:#ff4142;color:#fcfcfc}
		.mdui-page-container{position:relative;box-sizing:border-box;margin:0 auto;padding:0}
		.mdui-container-fluid{padding-top: 72px!important;}

		.template-row-split{width:100%;height:auto;max-width:750px;}
		.template-row-split::-webkit-scrollbar {display: none;}
		.template-row-split>ul{display:flex;align-items:center;padding: 0;margin: 4px 0px 0 0px;margin-top: 0;box-sizing: border-box;flex-wrap: wrap;background: #fff; display: none;}
		.template-row-split>ul>li{width: 20%;}
		.template-row-split>ul>li>a{display: block;color: #000; text-align: center;box-sizing: border-box;text-decoration: none;border-radius: 4px;}
		.template-row-split>ul>li>a>img{width: 40px;height: 40px;overflow: hidden;margin: 0 auto;display: block;transform: translateY(8px);}
		.template-row-split>ul>li>a>svg{padding: 4px;border-radius: 50%;overflow: hidden;margin: 0 auto;display: block;transform: translateY(8px);opacity: .8;}
		.template-row-split>ul>li>a>span{font-size:12px; display: block;border-radius: 6px;padding: 10px 4px 4px 4px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
		
		.template-row-split .mdui-sub-menus-switch{background: #FAFAFA; width: 100%; height: 40px; line-height: 40px; font-size: 12px; text-align: center; color: #999999; cursor: pointer;}
		.template-row-split .mdui-sub-menus-switch i{margin-bottom: 2px;}
		
		.mdui-nav{padding: 0px;display: flex;height: initial; box-shadow: none;background: inherit;;}
		.mdui-nav .mdui-tab{flex-grow: 1;}
		.mdui-nav .mdui-tab-expand{position: relative;line-height: 24px; margin-top: 2px;}
		
		.mdui-tab-header{background: #9F0000;}
		.mdui-logo-search{width: 100%; background: #FFF; display: flex; padding: 8px 8px 0px 8px;box-sizing: border-box;background: inherit;}
		.mdui-logo-search .logo{height:32px}
		.mdui-logo-search .logo_txt{color:#ff4142;font-size: 16px;letter-spacing: 2px;font-weight: bold;word-break: keep-all;height: 32px; line-height: 32px;display: block;}
		.mdui-logo-search .search-door{background: transparent; flex-grow: 1;border-radius: 20px;height: 30px; line-height: 30px; margin: 0px 12px 0px 16px; box-sizing: border-box;padding: 0px 8px; color: #BCBCBC;font-size: 13px;position: relative;}
		.mdui-logo-search .search-door > label{position: absolute;}
		.mdui-nav .mdui-tab a{color: #FFFFFF; }
		.mdui-nav .mdui-tab a.mdui-tab-active{color: #FFFFFF;}
		.mdui-tab-indicator{background: #FFFFFF;}
		.mdui-container-fluid{padding-top: 80px !important;}
		
		.mdui-nav-select>ul>li>span{color: #FF3D00;}
		.mdui-nav-select>ul>li>a{background: initial; border: 1px solid #e6e6e6;}
		.mdui-nav-select>ul>li>a.activeIndex{color: initial; background: initial;border-color:#FF3D00;}
		
		.mdui-bottom-nav >a:nth-child(3) > i{position: absolute; right: calc(50% - 18px);top: calc(10% - 10%); display: inline-block; width: 16px; height: 16px; background:#ED1400; font-size: 10px; text-align: center; line-height: 16px; border-radius: 50%; color: #FFF;font-style: normal;}
		
	</style>
</head>

<body class="mdui-bottom-nav-fixed">

	<div class="mdui-nav-container"></div>

	<div class="mdui-container-fluid mdui-p-t-5">
		<div class="template-row-split"></div>
		<div class="mdui-page-container"></div>
	</div>
	<div class="mdui-bottom-nav">
		<a href="list.html" class="mdui-ripple mdui-bottom-nav-active">
			<svg t="1586933266838" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8358" width="48" height="48"><path d="M556.586667 159.36l288.490666 183.914667A64 64 0 0 1 874.666667 397.248v392.746667a64 64 0 0 1-64 64l-224-0.021334V597.333333H448v256.64l-213.333333 0.042667a64 64 0 0 1-64-64V391.68a64 64 0 0 1 30.272-54.4l287.530666-178.346667a64 64 0 0 1 68.138667 0.426667z" p-id="8359" fill="#ff4142"></path></svg>
			<label class="language" language="shou_ye"></label>
		</a>
		<a href="catalog.html" class="mdui-ripple">
			<svg t="1587007028153" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7377" width="24" height="24"><path d="M256 734.101333v64H170.666667v-64h85.333333z m597.333333 0v64H298.666667v-64h554.666666zM256 493.184v64H170.666667v-64h85.333333z m597.333333 0v64H298.666667v-64h554.666666zM256 252.245333v64H170.666667v-64h85.333333z m597.333333 0v64H298.666667v-64h554.666666z" p-id="7378" fill="#2A363B"></path></svg>
			<label class="language" language="fen_lei"></label>
		</a>
		<a onclick="customerCart.openCart();" class="mdui-ripple">
			<svg t="1586933455682" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9017" width="48" height="48"><path d="M330.666667 768a53.333333 53.333333 0 1 1 0 106.666667 53.333333 53.333333 0 0 1 0-106.666667z m384 0a53.333333 53.333333 0 1 1 0 106.666667 53.333333 53.333333 0 0 1 0-106.666667zM94.762667 160h54.741333a96 96 0 0 1 92.906667 71.786667l1.024 4.394666L256.64 298.666667h0.213333l42.88 205.333333L332.224 661.333333h402.218667l61.653333-298.666666H313.813333l-13.376-64h495.68a64 64 0 0 1 62.677334 76.949333l-61.653334 298.666667A64 64 0 0 1 734.442667 725.333333H332.224a64 64 0 0 1-62.677333-51.050666l-60.586667-293.418667-0.405333 0.085333-27.733334-131.562666a32 32 0 0 0-28.309333-25.237334l-2.986667-0.149333H94.741333v-64h54.741334z" p-id="9018" fill="#2A363B"></path></svg>
			<label class="language" language="gou_wu_che"></label>
		</a>
		<a href="../user/index.html" class="mdui-ripple">
			<svg t="1586934464276" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9180" width="48" height="48"><path d="M644.8 581.568l160.64 187.456A64 64 0 0 1 756.842667 874.666667H267.157333a64 64 0 0 1-48.597333-105.642667l160.661333-187.434667c18.922667 11.52 39.466667 20.629333 61.205334 26.944L267.157333 810.666667H480v-128h64v128h212.842667l-173.269334-202.133334a254.613333 254.613333 0 0 0 61.226667-26.965333zM512 149.333333c117.824 0 213.333333 95.509333 213.333333 213.333334s-95.509333 213.333333-213.333333 213.333333-213.333333-95.509333-213.333333-213.333333S394.176 149.333333 512 149.333333z m0 64a149.333333 149.333333 0 1 0 0 298.666667 149.333333 149.333333 0 0 0 0-298.666667z" p-id="9181" fill="#2A363B"></path></svg>
			<label class="language" language="wo_de"></label>
		</a>
	</div>
</body>
<script src="../dists/mdui-0.4.3/js/mdui.js"></script>
<script src="../dists/swiper/js/swiper.js"></script>
<script src="../dists/art-template/template-web.js"></script>
<script src="../resources/js/echo.js"></script>
<script src="../resources/js/common.js"></script>
<script>
	!function(f,b,e,v,n,t,s)
	{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
	n.callMethod.apply(n,arguments):n.queue.push(arguments)};
	if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
	n.queue=[];t=b.createElement(e);t.async=!0;
	t.src=v;s=b.getElementsByTagName(e)[0];
	s.parentNode.insertBefore(t,s)}(window, document,'script',
	'https://connect.facebook.net/en_US/fbevents.js');
	fbq('init', commonConfig.getFbPiexId());
	fbq('track', 'PageView');
</script>

<script id="mdui-tab-container" type="text/html">
	<div class="mdui-tab-header">
		<div class="mdui-logo-search">
			<%if(shop.logo){%>
				<img class="logo" onclick="app.methods.openHome()" src="<%=shop.logo%>" />
			<% }else{ %>
				<span  class="logo_txt" onclick="app.methods.openHome()"><%=shop.name%></span>
			<% } %>
			<a class="search-door" href="#"></a>
			<span style="margin: 0px 4px 0px 2px; cursor: pointer;" onclick="footprint.open()">
				<svg t="1595812447638" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4595" width="30" height="30">
					<path d="M742.4 217.6c0-12.8 6.4-25.6 12.8-38.4 12.8-6.4 25.6-12.8 38.4-12.8 12.8 0 25.6 6.4 38.4 12.8 12.8 6.4 12.8 25.6 12.8 38.4 0 12.8-6.4 25.6-12.8 38.4-12.8 6.4-25.6 12.8-38.4 12.8-12.8 0-25.6-6.4-38.4-12.8-6.4-12.8-12.8-25.6-12.8-38.4zM601.6 128c0-12.8 6.4-32 19.2-44.8 12.8-12.8 25.6-19.2 44.8-19.2 19.2 0 32 6.4 44.8 19.2 12.8 12.8 19.2 25.6 19.2 44.8 0 19.2-6.4 32-19.2 44.8-12.8 12.8-25.6 19.2-44.8 19.2-19.2 0-32-6.4-44.8-19.2-12.8-12.8-19.2-25.6-19.2-44.8z m-185.6-25.6c0-19.2 6.4-38.4 19.2-51.2 12.8-12.8 32-19.2 51.2-19.2 19.2 0 38.4 6.4 51.2 19.2 12.8 12.8 19.2 32 19.2 51.2 0 19.2-6.4 38.4-19.2 51.2-12.8 12.8-32 19.2-51.2 19.2-19.2 0-38.4-6.4-51.2-19.2-12.8-12.8-19.2-32-19.2-51.2z m-236.8 12.8c0-25.6 12.8-44.8 25.6-64 19.2-19.2 44.8-25.6 64-25.6 25.6 0 51.2 12.8 64 25.6 19.2 19.2 25.6 38.4 25.6 64s-12.8 44.8-25.6 64c-19.2 19.2-44.8 25.6-64 25.6-25.6 0-51.2-12.8-64-25.6-19.2-19.2-25.6-38.4-25.6-64z m435.2 115.2H384h-6.4-12.8C281.6 236.8 217.6 300.8 217.6 384c0 57.6 32 102.4 76.8 134.4 0 0 89.6 44.8 0 268.8-6.4 19.2-12.8 38.4-12.8 57.6 0 83.2 70.4 153.6 160 153.6 38.4 0 76.8-12.8 102.4-38.4 160-128 262.4-320 262.4-537.6v-6.4c0-96-83.2-185.6-192-185.6z" fill="#FFFFFF" p-id="2499"></path>
				</svg>
			</span>
			<a href="https://m.me/<%=shop.customerId%>">
				<svg t="1595812447638" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4595" width="30" height="30">
					<path d="M512 53.333333c-261.546667 0-458.666667 165.973333-458.666667 386.133334 0 159.573333 101.546667 295.04 265.173334 353.493333a11.306667 11.306667 0 0 1 7.893333 11.946667 359.893333 359.893333 0 0 1-34.773333 98.133333A32 32 0 0 0 320 949.76a32.426667 32.426667 0 0 0 7.466667 0c3.626667 0 89.386667-21.333333 236.16-124.373333a11.733333 11.733333 0 0 1 5.333333-1.92c232.746667-23.253333 401.706667-183.466667 401.706667-384 0-220.16-197.12-386.133333-458.666667-386.133334z m74.666667 490.666667h-213.333334a32 32 0 0 1 0-64h213.333334a32 32 0 0 1 0 64z m64-128h-277.333334a32 32 0 0 1 0-64h277.333334a32 32 0 0 1 0 64z" p-id="4596" fill="#FFFFFF"></path>
				</svg>
			</a>
		</div>
		<div class="mdui-nav">
			<div class="mdui-tab" id="id-mdui-tab">
				<% for (var i = 0; i < shop.list.length; i++) { %>
				<a href="#<%=shop.list[i].id%>" class="mdui-ripple <%= shop.list[i].isShow ? '' : 'hide' %>"><%=shop.list[i].name%></a>
				<% } %>
			</div>
			<button class="mdui-btn mdui-btn-icon mdui-tab-expand"><svg t="1595812689165" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5902" width="24" height="24"><path d="M73.142379 731.42881C32.73119 731.42881 0 764.16 0 804.57119s32.73119 73.142379 73.142379 73.142379c40.374379 0 73.142379-32.73119 73.142379-73.142379C146.286431 764.19681 113.553569 731.42881 73.142379 731.42881zM329.142379 256l658.284758 0c20.18719 0 36.57119-16.384 36.57119-36.57119 0-20.18719-16.384-36.57119-36.57119-36.57119L329.142379 182.857621c-20.18719 0-36.57119 16.384-36.57119 36.57119C292.57119 239.616 308.95519 256 329.142379 256zM73.142379 438.857621C32.73119 438.857621 0 471.625621 0 512c0 40.41119 32.73119 73.142379 73.142379 73.142379 40.374379 0 73.142379-32.768 73.142379-73.142379C146.286431 471.625621 113.553569 438.857621 73.142379 438.857621zM987.42881 475.42881 329.142379 475.42881c-20.18719 0-36.57119 16.384-36.57119 36.57119 0 20.18719 16.384 36.57119 36.57119 36.57119l658.284758 0c20.18719 0 36.57119-16.384 36.57119-36.57119C1024 491.81281 1007.616 475.42881 987.42881 475.42881zM987.42881 768 329.142379 768c-20.18719 0-36.57119 16.384-36.57119 36.57119 0 20.185516 16.384 36.569516 36.57119 36.569516l658.284758 0c20.18719 0 36.57119-16.384 36.57119-36.569516C1024 784.384 1007.616 768 987.42881 768zM73.142379 146.286431C32.73119 146.286431 0 179.054431 0 219.42881s32.73119 73.142379 73.142379 73.142379c40.374379 0 73.142379-32.768 73.142379-73.142379S113.553569 146.286431 73.142379 146.286431z" p-id="5903" fill="#FFFFFF"></path></svg></button>
		</div>
	</div>
	<div class="mdui-nav-select">
		<ul>
			<li style="font-size: 15px; color: #333; font-weight: 600;width: 50% !important;"><span class="language" language="quan_bu_fen_lei"></span></li>
			<li class="mdui-text-right" style="font-weight: 300; color: #A8A8A8;width: 50% !important;">
				<button class="mdui-btn mdui-btn-icon mdui-tab-close">
					<svg t="1587020841649" class="icon" viewBox="0 0 1045 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6538" width="24" height="24"><path d="M282.517333 213.376l-45.354666 45.162667L489.472 512 237.162667 765.461333l45.354666 45.162667L534.613333 557.354667l252.096 253.269333 45.354667-45.162667-252.288-253.44 252.288-253.482666-45.354667-45.162667L534.613333 466.624l-252.096-253.226667z" p-id="6539" fill="#000000"></path></svg>
				</button>
			</li>
		</ul>
		<ul class="second_nav">
			<% for (var i = 0; i < shop.list.length; i++) { %>
			<li class="<%= shop.list[i].isShow ? '' : 'hide' %>"><a _id="<%=shop.list[i].id%>" _index="<%=i%>"><%=shop.list[i].name%></a></li>
			<% } %>
		</ul>
	</div>
</script>
<script id="template-row-split" type="text/html">
	<% if (list.length > 0) { %>
	<div class="mdui-sub-menus-switch" switch="off" onclick="app.methods.subMenuSwitchClick();"><span>เลือกหมวดรอง</span><i class="mdui-icon material-icons">expand_more</i></div>
	<ul>
		<% for (var i = 0; i < list.length; i++) { %>
		<li>
			<a href="slist.html?_id=<%= list[i].parentId %>&_subId=<%= list[i].id %>">
				<img src="<%= list[i].thumb %>" />
				<span><%=list[i].name%></span>
			</a>
		</li>
		<% } %>
		<% if (i >= 9) { %>
		<li>
			<a href="slist.html?_id=<%=list[0].parentId%>">
				<svg t="1588045780258" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7560" width="32" height="32"><path d="M490.666667 533.333333v256a64 64 0 0 1-64 64h-192a64 64 0 0 1-64-64v-192a64 64 0 0 1 64-64h256z m298.666666 0a64 64 0 0 1 64 64v192a64 64 0 0 1-64 64h-192a64 64 0 0 1-64-64V533.333333h256z m-362.666666 64h-192v192h192v-192z m362.666666 0h-192v192h192v-192zM426.666667 170.666667a64 64 0 0 1 64 64v256H234.666667a64 64 0 0 1-64-64v-192a64 64 0 0 1 64-64h192z m266.666666 0a160 160 0 1 1 0 320 160 160 0 0 1 0-320zM426.666667 234.666667h-192v192h192v-192z m266.666666 0a96 96 0 1 0 0 192 96 96 0 0 0 0-192z" p-id="7561" fill="#FF4142"></path></svg><span class="language" language="cha_kan_quan_bu"></span>
			</a>
		</li>
		<% } %>
	</ul>
	<% } %>
</script>
<script>
	$$(function () {
		app.init();
	});

	var app = {
		datas: {
			adlk: cacheSessionStorage.getCache('adlk'),
			id: tools.getURLParam('id'),
			anavId: tools.getURLParam('anavId'),
			navInfo: null,
			inst: null
		},
		methods: {
			openHome: function(){
				window.location.href = 'list.html'
			},
			initNavInfo: function () {
				tools.loading(2000);
				app.datas.navInfo = cacheSessionStorage.getCache('_navInfo');
				if (!app.datas.navInfo || app.datas.navInfo.length == 0) {
					$$.ajax({
						url: commonConfig.websitePrefix() + "/api/shop",
						success: function (data) {
							app.datas.navInfo = data.datas;
							cacheSessionStorage.setCache('_navInfo', app.datas.navInfo);
							app.methods.renderNavInfo();
						},
						complete: function () {
							tools.hideLoading();
						}
					})
				} else {
					app.methods.renderNavInfo();
				}
			},
			renderNavInfo: function () {
				$$('.mdui-nav-container').html(template('mdui-tab-container', {
					'shop': {
						list: app.datas.navInfo.shopNavs,
						logo: cacheSessionStorage.getCache('shopInfo').logo,
						name: cacheSessionStorage.getCache('shopInfo').domainName,
						customerId: commonConfig.getCustomerIdByHost()
					}
				}));
				app.events.mduiNavSelect();
				app.methods.mduiNavCuurentNav();
				
				// 渲染左侧菜单
				_drawer.renderDrawer(app.datas.navInfo.shopNavs);
				
				globalization.render();
			},
			mduiNavCuurentNav: function () {
				// 初始化横向滚动的导航
				app.datas.inst = new mdui.Tab('.mdui-nav > div.mdui-tab');
				// 点击横向导航打开聚合的事件
				app.events.mduiNavClick();
				if (app.datas.id != null && app.datas.id) {
					// 有id时，加载对应id的一级导航页面
					var _tmpIndex = 0; // id在tab中对应的index
					$$.each(app.datas.inst.$tabs, function (i, tab) {
						if (tab.hash.substr(1) == app.datas.id) {
							_tmpIndex = i;
							return false;
						}
					})
					// 查询到，有对应的tab
					if (_tmpIndex != null) {
						app.datas.inst.show(_tmpIndex);
						return;
					}else{
						// 否则加载首页
						app.methods.mduiNavCuurentNavInfo(app.datas.navInfo.shopNavs[0]);
					}
				}else{
					// 默认打开导航中第一个页面（首页逻辑）
					app.methods.mduiNavCuurentNavInfo(app.datas.navInfo.shopNavs[0]);
				}
			},
			mduiNavCuurentNavInfo: function (nav) {
				// 加载二级导航
				if (!nav) {
					tools.hideLoading();
					return;
				}
				// 5个一行，5-10个，显示四个+查看更多，10+，显示9个+查看更多
				var _list = [];
				$$.each(nav.subs, function (index, value) {
					if (value.isShow) {
						value.parentId = nav.id;
						_list.push(value);
					};
				});
				if(_list.length > 9){
					_list.length = 9
				}
				$$('.template-row-split').html(template('template-row-split', {
					'list': _list
				}));
//				if(_list.length > 0){
//					$$('.mdui-page-container').css('margin-top', '43px');
//				}else{
//					$$('.mdui-page-container').css('margin-top', '0px');
//				}
				// 默认加载该导航下二级导航中不显示的哪一个数据
				var navIds = [];
				$$.each(nav.subs, function (index, sub) {
					if (!sub.isShow) navIds.push(sub.id);
				});
				$$.ajax({
					url: commonConfig.websitePrefix() + '/api/shop/collections?navId=' + navIds.join('~') + (app.datas.anavId && app.datas.anavId != '' ? '&anavId=' + app.datas.anavId : '') + (app.datas.adlk && app.datas.adlk != '' ? '&adlk=' + app.data.adlk : ''),
					success: function (data) {
						if (!data.datas || data.datas.length == 0) {
							mdui.snackbar({
								message: language.text('hao_xiang_zou_diu_le'),
								position: 'top'
							});
							app.datas.inst.show(0);
							tools.hideLoading();
						} else {
							document.body.scrollTop = 0;
							document.documentElement.scrollTop = 0;
							app.methods.renderMduiNavCuurentNavModules(data.datas);
							echo.init({
								offset: 667,
								throttle: 0
							});
						}
					},
					complete: function () {
						tools.hideLoading();
						app.datas.anavId = null;
					}
				});
			},
			// 如果有满减活动,需要再这里呈现
			renderMduiNavCuurentNavModules: function (collectionDatas) {
				app.methods.resetModuleContainer();
				app.methods.reloactionNav();
				if (collectionDatas && collectionDatas.length > 0) {
					$$.each(collectionDatas, function (index, collection) {
						try {
							if(app.datas.inst.activeIndex == 0){
								app.methods.renderModuleInfos(collection);
								if(index == 0)_marketing.renderPromotions();
							}else{
								if(index == 0)_marketing.renderPromotions();
								app.methods.renderModuleInfos(collection);
							}
						} catch (e) {
							console.log(e);
						}
					});
				} else {
					mdui.snackbar({
						message: language.text('hao_xiang_zou_diu_le'),
						position: 'top'
					});
				}
				tools.hideLoading();
			},
			resetModuleContainer: function () {
				$$('.mdui-page-container').html('');
				$$('script[attr="pageCustom"]').remove();
				tools.removeTemplateCssCode();
			},
			renderModuleInfos: function (collection) {
				tools.loadCssCode(collection.present, 'pageCustom');
				var guid = $$.guid();
				$$('body').append('<script id="mdui-page-container-' + guid +
					'" attr="pageCustom" type="text/html">' + collection.template + '<\/script>');
				var _domHtml = template('mdui-page-container-' + guid, {
					'collection': collection
				});
				$$('.mdui-page-container').append('<div class="pro_box" _index="' + collection.collectionId +
					'">' + _domHtml + '</div>');
				if (collection.script && collection.script != '') eval(collection.script);
			},
			reloactionNav: function () {
				if($$('.mdui-nav .mdui-tab a.mdui-tab-active').length == 0) return ; 
				var _offset = $$('.mdui-nav .mdui-tab a.mdui-tab-active').offset();
				var _navWidth = $$('.mdui-nav .mdui-tab').width();
				$$('.mdui-nav .mdui-tab')[0].scrollLeft = $$('.mdui-nav .mdui-tab')[0].scrollLeft + _offset.left - (_navWidth - _offset.width) / 2
			},
			reWriteUrl: function(id){
				// 刷新路由
				if(id == tools.getURLParam('id')){
					return false
				}
				var newURL = window.location.origin + window.location.pathname + '?id=' + id;
				history.pushState({'url': newURL }, '', newURL);
			},
			subMenuSwitchClick: function(){
				var _switchDom = $$('.mdui-sub-menus-switch') ;
				var _switch = _switchDom.attr('switch');
				if(_switch == 'on'){
					$$('.template-row-split>ul').css('display','none');
					//$$.hideOverlay();
					_switchDom.find('i').html('expand_more');
					_switchDom.attr('switch', 'off');
				}else if(_switch == 'off'){
					//$$.showOverlay(1);
					$$('.template-row-split>ul').css('display', 'flex');
					_switchDom.find('i').html('expand_less');
					_switchDom.attr('switch', 'on');
				}
			},
			initShoppingCart : function(){
				// 计算购物车个数
			   var _count = 0 ;
				var cartProducts = cacheLocalstorage.getCache('cartProducts') || [] ;
					$$.each(cartProducts, function(index, temp){
							_count += parseInt(temp.quantity);
					  });
					$$('.mdui-bottom-nav >a:nth-child(3)').html('<svg t="1586933455682" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9017" width="28" height="28"><path d="M330.666667 768a53.333333 53.333333 0 1 1 0 106.666667 53.333333 53.333333 0 0 1 0-106.666667z m384 0a53.333333 53.333333 0 1 1 0 106.666667 53.333333 53.333333 0 0 1 0-106.666667zM94.762667 160h54.741333a96 96 0 0 1 92.906667 71.786667l1.024 4.394666L256.64 298.666667h0.213333l42.88 205.333333L332.224 661.333333h402.218667l61.653333-298.666666H313.813333l-13.376-64h495.68a64 64 0 0 1 62.677334 76.949333l-61.653334 298.666667A64 64 0 0 1 734.442667 725.333333H332.224a64 64 0 0 1-62.677333-51.050666l-60.586667-293.418667-0.405333 0.085333-27.733334-131.562666a32 32 0 0 0-28.309333-25.237334l-2.986667-0.149333H94.741333v-64h54.741334z" p-id="9018" fill="#2A363B"></path></svg><label>'+ language.text("gou_wu_che") +'</label>'+(_count > 0 ? '<i>'+_count+'</i>' : ''));
			},
		},
		events: {
			mduiNavSelect: function () {
				// 展开导航
				$$('button.mdui-tab-expand').off('click').on('click', function (e) {
					$$.showOverlay(1);
					$$('.mdui-nav-select').show();
					$$('.mdui-nav-select ul > li > a').removeClass('activeIndex');
					$$('.mdui-nav-select ul > li > a[_id="' + $$(app.datas.inst.$tabs[app.datas.inst.activeIndex]).attr('href').substr(1) + '"]').addClass('activeIndex');

					// 关闭导航
					$$('.mdui-overlay.mdui-overlay-show').off('click').on('click', function () {
						if ($$('.mdui-nav-select').css('display') == "block") {
							$$('.mdui-nav-select').hide();
							$$.hideOverlay();
						}
					});
				});

				// 关闭导航
				$$('button.mdui-tab-close').off('click').on('click', function (e) {
					$$('.mdui-nav-select').hide();
					$$.hideOverlay(true);
				});

				// 导航打开页面
				$$('.mdui-nav-select ul > li > a').off('click').on('click', function (e) {
					$$.hideOverlay();
					// 切换横划一级导航
					$$('.mdui-nav #id-mdui-tab').css('display','flex')
					// $$('.mdui-nav .mdui-tab-expand').hide()
					// 渲染内容
					$$('.mdui-nav-select ul > li > a').removeClass('activeIndex');
					$$(this).addClass('activeIndex');
					$$('.mdui-nav-select').hide();
					app.datas.inst.show(parseInt($$(this).attr('_index')));
				});
			},
			mduiNavClick: function () {
				document.getElementById('id-mdui-tab').addEventListener('change.mdui.tab', function (event) {
					$$.each(app.datas.navInfo.shopNavs, function (i, value) {
						if (value.id == event.detail.id) {
							// 刷新路由
							app.methods.reWriteUrl(event.detail.id)
							app.methods.mduiNavCuurentNavInfo(value);
							return false;
						}
					})
				});
			},
			locationEvent: function(){
				window.addEventListener("popstate", function(e) {
					var new_id = tools.getURLParam('id')
//					if(new_id == ''){
//						app.methods.openHome()
//						return false
//					}
					$$.each(app.datas.navInfo.shopNavs, function (i, value) {
						if (value.id == new_id) {
							app.datas.inst.show(i);
							return false;
						}
					})
				}, false);
			},
	
		},
		init: function () {
			app.methods.initNavInfo();
			app.events.locationEvent();
			app.methods.initShoppingCart();
		}
	}
</script>

</html>